import { onLoad } from '@dcloudio/uni-app'
import { getBannerListAPI } from '@/services/homeApi'
import type { BannerType } from '@/types/banner'
import { ref } from 'vue'

export const useBannerList = () => {
  const banner_list = ref<BannerType[]>([])
  const getBannerList = async () => {
    const res = await getBannerListAPI()
    console.log(res.data)
    banner_list.value = res.data as BannerType[]
  }
  return {
    banner_list,
    getBannerList,
  }
}
